package com.example.eureka_client.service;

import com.example.eureka_client.entity.AttentionQuestion;
import com.example.eureka_client.entity.Question;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.eureka_client.utils.PageRequest;
import com.example.eureka_client.utils.PageResult;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 问题表 服务类
 * </p>
 *
 * @author plj
 * @since 2022-03-24
 */
public interface IQuestionService extends IService<Question> {
    Question getById(String id);
    boolean delById(String id);
    PageResult getAllQuestionByUserId(String userId, PageRequest pageRequest);

    PageResult sortByWatchUserNum(PageRequest pageRequest);
    PageResult sortByTime(PageRequest pageRequest);
    PageResult sortRandom(PageRequest pageRequest);

    PageResult getAttentionQuestion(List<String> questionIds, PageRequest pageRequest);

    boolean editQuestion(String questionId, String title, String content);
    boolean addWatchNum(String questionId);
    boolean addAgreeNum(String questionId, String UserId);
    boolean addAttentionNum(AttentionQuestion attentionQuestion);

    boolean reAgreeNum(String questionId, String UserId);
    boolean reAttentionNum(AttentionQuestion attentionQuestion);

    boolean agree(String questionId, String UserId);
    boolean attention(String questionId, String UserId);
}
